<%@page import="br.com.fiap.vo.UsuarioVO"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%

    UsuarioVO usuarioVO = (UsuarioVO) request.getSession().getAttribute("usuario");
    if (usuarioVO == null) {
        response.sendRedirect(request.getContextPath() + "/index.jsp?msg=Acesso negado!");
    }




%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="./css/avaliacao.css" rel="stylesheet" type="text/css" />
        <title>Alterar Senha</title>
        <script type="text/javascript">
            function goBack(){
                window.history.back()
            }
            function confirmar(){
                var senha = document.getElementById("senha").value;
                if(senha.trim() == ""){
                    alert("senha não informada! ");
                    document.getElementById("senha").focus();
                    return false;
                    
                }
                document.formSenha.submit();

            }
        </script>
    </head>
    <body>
        <form name="formSenha"  method="post" action="aluno">
            <input type="hidden" id="acao" name="acao" value="alteraSenha"/>
            <table  class="tabela_input">
                <tr>
                    <td>Usuário: </td>
                    <td><input type="text" id="user" readonly="true" name="user" value="<%=usuarioVO.getUsuario()%>"/></td>
                </tr>
                <tr>
                    <td>Senha Antiga: </td>
                    <td><input type="text" id="senhaAntiga" readonly="true" name="senhaAntiga" value="<%=usuarioVO.getSenha()%>"/></td>
                </tr>
                <tr>
                    <td>Nova Senha: </td>
                    <td><input type="text" id="senha"  name="senha" value="" /></td>
                </tr>
            </table>
            <table  align="center">
                <tr>
                    <td><a href="#" onclick="javaScript:goBack();">Voltar</a></td>
                    <td><a href="#" onclick="javaScript:confirmar();">Confirmar</a></td>
                </tr>            
            </table>  
        </form>      
    </body>
</html>
